#!/usr/bin/python
# -*- coding: utf-8 -*-

#    THIS PROGRAM USE MINGUS Python Package
#

#    Jeremy Bernatchez-Sainvil master@1804hs.org 2012 Muffin-Man
#    mingus - Music theory Python package, scales module.
#    Copyright (C) 2008-2009, Bart Spaans
#    Copyright (C) 2011, Carlo Stemberger
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Scales finder 
# Choose a mode and a note, and that's it

from mingus.core import *
import mingus.core.chords as chords

print "[+]Generate chords. CHORDS BUILDER : master@1804hs.org \n "

print """[+]        Diatonic Chords
0.  I    (tonic)
1.  II   (supertonic)
2.  III  (mediant)
3.  IV   (subdominant)
4.  V    (dominant)
5.  VI   (submediant)
6.  VII  (subtonic)
7.  I7   (tonic7)
8.  II7  (supertonic7)
9.  III7 (mediant7)
10. IV7  (subdominant7)
11. V7   (dominant7)
12. VI7  (submediant7)
13. VII7 (subtonic7)
\n\n[+]        Others
14. Triad on note of key
15. Triads (all the triads in the key)
16. Major triad 
17. Minor triad 
18. Diminished triad 
19. Augmented triad 
20. Seventh chord on note of key
21. Sevenths (all the sevenths in the key)
22. Major seventh
23. Minor seventh 
24. Dominant seventh
25. Half diminished seventh / minor seventh flat five
26. Diminished seventh
27. Minor major seventh
28. Minor sixth
29. Major sixth
30. Dominant sixth
31. Sixth ninth
32. Minor ninth
33. Major ninth
34. Dominant ninth
35. Dominant flat ninth
36. Dominant sharp ninth
37. Eleventh
38. Minor eleventh
38. Minor thirteenth
40. Major thirteenth
41. Dominant thirteenth
42. Suspended second triad
43. Suspended fourth triad
44. Suspended seventh
45. Suspended fourth ninth
46. Augmented major seventh
47. Augmented minor seventh
48. Dominant flat five
49. Lydian dominant seventh
50. Hendrix chord

"""

user_mode = int(raw_input("Choose a mode (number) : "))

if user_mode == 14 or user_mode == 20:  # ERREUR 
    user_tNote = str.capitalize(raw_input('Enter a note : '))
    user_tKey = str.capitalize(raw_input('Enter a key : '))

elif user_mode == 16 or user_mode == 17 or user_mode == 18 or user_mode == 19 or user_mode > 22:
   user_tNote = str.capitalize(raw_input('Enter a note : '))

else:
    user_key = str(raw_input("Enter a Key : "))


if user_mode == 0:
    print chords.I(user_key)

if user_mode == 1:
    print chords.II(user_key)

if user_mode == 2:
    print chords.III(user_key)

if user_mode == 3:
    print chords.IV(user_key)

if user_mode == 4:
    print chords.V(user_key)

if user_mode == 5:
    print chords.VI(user_key)

if user_mode == 6:
    print chords.VII(user_key)

if user_mode == 7:
    print chords.I7(user_key)

if user_mode == 8:
    print chords.II7(user_key)

if user_mode == 9:
    print chords.III7(user_key)

if user_mode == 10:
    print chords.IV7(user_key)

if user_mode == 11:
    print chords.V7(user_key)

if user_mode == 12:
    print chords.VI7(user_key)

if user_mode == 13:
    print chords.VII7(user_key)

if user_mode == 14:
    print chords.triad(user_tNote, user_tKey)

if user_mode == 15:
    print chords.triads(user_key)

if user_mode == 16:
    print chords.major_triad(user_tNote)

if user_mode == 17:
    print chords.minor_triad(user_tNote)

if user_mode == 18:
    print chords.diminished_triad(user_tNote)

if user_mode == 19:
    print chords.augmented_triad(user_tNote)

if user_mode == 20:
    print chords.seventh(user_tNote, user_tKey)

if user_mode == 21:
    print chords.sevenths(user_key)

if user_mode == 22:
    print chords.major_seventh(user_tNote)

if user_mode == 23:
    print chords.minor_seventh(user_tNote)

if user_mode == 24:
    print chords.dominant_seventh(user_tNote)

if user_mode == 25:
    print chords.half_diminished_seventh(user_tNote)

if user_mode == 26:
    print chords.diminished_seventh(user_tNote)

if user_mode == 27:
    print chords.minor_major_seventh(user_tNote)

if user_mode == 28:
    print chords.minor_sixth(user_tNote)

if user_mode == 29:
    print chords.major_sixth(user_tNote)

if user_mode == 30:
    print chords.dominant_sixth(user_tNote)

if user_mode == 31:
    print chords.sixth_ninth(user_tNote)

if user_mode == 32:
    print chords.minor_ninth(user_tNote)

if user_mode == 33:
    print chords.major_ninth(user_tNote)

if user_mode == 34:
    print chords.dominant_ninth(user_tNote)

if user_mode == 35:
    print chords.dominant_flat_ninth(user_tNote)

if user_mode == 36:
    print chords.dominant_sharp_ninth(user_tNote)

if user_mode == 37:
    print chords.eleventh(user_tNote)

if user_mode == 38:
    print chords.minor_eleventh(user_tNote)

if user_mode == 39:
    print chords.minor_thirteenth(user_tNote)

if user_mode == 40:
    print chords.major_thirteenth(user_tNote)

if user_mode == 41:
    print chords.dominant_thirteenth(user_tNote)

if user_mode == 42:
    print chords.suspended_second_triad(user_tNote)

if user_mode == 43:
    print chords.suspended_fourth_triad(user_tNote)

if user_mode == 44:
    print chords.suspended_seventh(user_tNote)

if user_mode == 45:
    print chords.suspended_fourth_ninth(user_tNote)

if user_mode == 46:
    print chords.diminished_seventh(user_tNote)

if user_mode == 47:
    print chords.augmented_major_seventh(user_tNote)

if user_mode == 48:
    print chords.augmented_minor_seventh(user_tNote)

if user_mode == 49:
    print chords.dominant_flat_five(user_tNote)

if user_mode == 50:
    print chords.lydian_dominant_seventh(user_tNote)

if user_mode == 51:
    print chords.hendrix_chord(user_tNote)

